using UseCaseManager.BO;

namespace UseCaseManager.Test.BO
{
    public class TestUtilsUseCaseStep
    {
        /// <summary>
        /// Creates a new saved UseCaseStep with a random value assigned to every property
        /// </summary>
        public static UseCaseStep CreateSavedUseCaseStep()
        {
            UseCaseStep useCaseStep = CreateUnsavedValidUseCaseStep();
            useCaseStep.Save();
            return useCaseStep;
        }

        /// <summary>
        /// Creates a new unsaved UseCaseStep with a random value assigned to every property
        /// </summary>
        public static UseCaseStep CreateUnsavedValidUseCaseStep()
        {
            UseCaseStep useCaseStep = new UseCaseStep();
            useCaseStep.UseCaseID = TestUtilsUseCase.CreateSavedUseCase().UserCaseID;
            useCaseStep.StepNumber = TestUtils.GetRandomInt();
            useCaseStep.StepDescription = TestUtils.GetRandomString();
            useCaseStep.UserLastUpdated = TestUtils.GetRandomString();
            useCaseStep.DateTimeLastUpdated = TestUtils.GetRandomDate();
            return useCaseStep;
        }
	    
        /// <summary>
        /// Creates a new unsaved UseCaseStep where all properties are null, except ID properties
        /// and those with default values.  If there are compulsory properties without
        /// defaults, saving the object will throw an exception.
        /// </summary>
        public static UseCaseStep CreateUnsavedDefaultUseCaseStep()
        {
            UseCaseStep useCaseStep = new UseCaseStep();
            return useCaseStep;
        }
    }
}